<?php
namespace process;

use app\extensions\api\Oss;
use app\model\TokenInfo;
use app\queue\redis\download\DownToken;
use Workerman\Crontab\Crontab;

class Task
{
    public function onWorkerStart()
    {

        new Crontab('0 * * * *', function(){
            // 每天的更新失效设备token
            $TokenInfo = new TokenInfo();
            $TokenInfo->refreshInvalid();

            //删除失效的下载文件
            $Oss = new Oss();
            $Oss->deleteList(DownToken::$path,7);
        });

    }
}